package com.lyb.spzx.manager.controller;

import com.lyb.spzx.manager.service.SysRoleUserService;
import com.lyb.spzx.model.dto.system.AssginRoleDto;
import com.lyb.spzx.model.vo.common.Result;
import com.lyb.spzx.model.vo.common.ResultCodeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 分配角色
 */
@Tag(name = "分配角色")
@RestController
@RequestMapping("/admin/system/sysRoleUser")
public class SysRoleUserController {

    @Autowired
    private SysRoleUserService sysRoleUserService;

    @Operation(summary = "分配角色")
    @PutMapping("/doAssignRole")
    public Result saveRoleUser(@RequestBody AssginRoleDto assginRoleDto){
        sysRoleUserService.doAssgin(assginRoleDto);
        return Result.build(null, ResultCodeEnum.SUCCESS);
    }
}
